module('getters', {
  setup: function() {
    // 2010-01-01 00:00:00 +0000
    this.psoe = ADT.fromTimestamp(1262304000);
    this.psoe.setTZOffset(0);

    // 2010-07-12 07:34:41 +0000
    this.pmoe = ADT.fromTimestamp(1278920081);
    this.pmoe.setTZOffset(0);

    // 2010-12-31 23:59:59 +0000
    this.peoe = ADT.fromTimestamp(1293839999);
    this.peoe.setTZOffset(0);

    // 1956-01-01 00:00:00 +0000
    this.nsoe = ADT.fromTimestamp(-441849600);
    this.nsoe.setTZOffset(0);

    // 1956-07-12 07:34:41 +0000
    this.nmoe = ADT.fromTimestamp(-425147119);
    this.nmoe.setTZOffset(0);

    // 1956-12-31 23:59:59 +0000
    this.neoe = ADT.fromTimestamp(-410227201);
    this.neoe.setTZOffset(0);

    // 1970-01-01 00:00:00 +0000
    this.zero = ADT.fromTimestamp(0);
    this.zero.setTZOffset(0);

    // 1969-12-31 23:59:59 +0000
    this.minus_one = ADT.fromTimestamp(-1);
    this.minus_one.setTZOffset(0);

    // 2010-07-12 07:34:41 +0300
    this.local = ADT.fromTimestamp(1278909281);
    this.local.setTZOffset(10800);
  }
});

test('ADT.prototype.getYear', function() {
  expect(9);

  equals(
    this.psoe.getYear(),
    2010,
    'psoe.getYear()');

  equals(
    this.pmoe.getYear(),
    2010,
    'pmoe.getYear()');

  equals(
    this.peoe.getYear(),
    2010,
    'peoe.getYear()');

  equals(
    this.nsoe.getYear(),
    1956,
    'nsoe.getYear()');

  equals(
    this.nmoe.getYear(),
    1956,
    'nmoe.getYear()');

  equals(
    this.neoe.getYear(),
    1956,
    'neoe.getYear()');

  equals(
    this.zero.getYear(),
    1970,
    'zero.getYear()');

  equals(
    this.minus_one.getYear(),
    1969,
    'minus_one.getYear()');

  equals(
    this.local.getYear(),
    2010,
    'local.getYear()');
});

test('ADT.prototype.getMonth', function() {
  expect(9);

  equals(
    this.psoe.getMonth(),
    1,
    'psoe.getMonth()');

  equals(
    this.pmoe.getMonth(),
    7,
    'pmoe.getMonth()');

  equals(
    this.peoe.getMonth(),
    12,
    'peoe.getMonth()');

  equals(
    this.nsoe.getMonth(),
    1,
    'nsoe.getMonth()');

  equals(
    this.nmoe.getMonth(),
    7,
    'nmoe.getMonth()');

  equals(
    this.neoe.getMonth(),
    12,
    'neoe.getMonth()');

  equals(
    this.zero.getMonth(),
    1,
    'zero.getMonth()');

  equals(
    this.minus_one.getMonth(),
    12,
    'minus_one.getMonth()');

  equals(
    this.local.getMonth(),
    7,
    'local.getMonth()');
});

test('ADT.prototype.getDay', function() {
  expect(9);

  equals(
    this.psoe.getDay(),
    1,
    'psoe.getDay()');

  equals(
    this.pmoe.getDay(),
    12,
    'pmoe.getDay()');

  equals(
    this.peoe.getDay(),
    31,
    'peoe.getDay()');

  equals(
    this.nsoe.getDay(),
    1,
    'nsoe.getDay()');

  equals(
    this.nmoe.getDay(),
    12,
    'nmoe.getDay()');

  equals(
    this.neoe.getDay(),
    31,
    'neoe.getDay()');

  equals(
    this.zero.getDay(),
    1,
    'zero.getDay()');

  equals(
    this.minus_one.getDay(),
    31,
    'minus_one.getDay()');

  equals(
    this.local.getDay(),
    12,
    'local.getDay()');
});

test('ADT.prototype.getDayOfYear', function() {
  expect(9);

  equals(
    this.psoe.getDayOfYear(),
    1,
    'psoe.getDayOfYear()');

  equals(
    this.pmoe.getDayOfYear(),
    193,
    'pmoe.getDayOfYear()');

  equals(
    this.peoe.getDayOfYear(),
    365,
    'peoe.getDayOfYear()');

  equals(
    this.nsoe.getDayOfYear(),
    1,
    'nsoe.getDayOfYear()');

  equals(
    this.nmoe.getDayOfYear(),
    194,
    'nmoe.getDayOfYear()');

  equals(
    this.neoe.getDayOfYear(),
    366,
    'neoe.getDayOfYear()');

  equals(
    this.zero.getDayOfYear(),
    1,
    'zero.getDayOfYear()');

  equals(
    this.minus_one.getDayOfYear(),
    365,
    'minus_one.getDayOfYear()');

  equals(
    this.local.getDayOfYear(),
    193,
    'local.getDayOfYear()');
});

test('ADT.prototype.getDayOfWeek', function() {
  expect(9);

  equals(
    this.psoe.getDayOfWeek(),
    5,
    'psoe.getDayOfWeek()');

  equals(
    this.pmoe.getDayOfWeek(),
    1,
    'pmoe.getDayOfWeek()');

  equals(
    this.peoe.getDayOfWeek(),
    5,
    'peoe.getDayOfWeek()');

  equals(
    this.nsoe.getDayOfWeek(),
    0,
    'nsoe.getDayOfWeek()');

  equals(
    this.nmoe.getDayOfWeek(),
    4,
    'nmoe.getDayOfWeek()');

  equals(
    this.neoe.getDayOfWeek(),
    1,
    'neoe.getDayOfWeek()');

  equals(
    this.zero.getDayOfWeek(),
    4,
    'zero.getDayOfWeek()');

  equals(
    this.minus_one.getDayOfWeek(),
    3,
    'minus_one.getDayOfWeek()');

  equals(
    this.local.getDayOfWeek(),
    1,
    'local.getDayOfWeek()');
});

test('ADT.prototype.getHour', function() {
  expect(9);

  equals(
    this.psoe.getHour(),
    0,
    'psoe.getHour()');

  equals(
    this.pmoe.getHour(),
    7,
    'pmoe.getHour()');

  equals(
    this.peoe.getHour(),
    23,
    'peoe.getHour()');

  equals(
    this.nsoe.getHour(),
    0,
    'nsoe.getHour()');

  equals(
    this.nmoe.getHour(),
    7,
    'nmoe.getHour()');

  equals(
    this.neoe.getHour(),
    23,
    'neoe.getHour()');

  equals(
    this.zero.getHour(),
    0,
    'zero.getHour()');

  equals(
    this.minus_one.getHour(),
    23,
    'minus_one.getHour()');

  equals(
    this.local.getHour(),
    7,
    'local.getHour()');
});

test('ADT.prototype.getMinute', function() {
  expect(9);

  equals(
    this.psoe.getMinute(),
    0,
    'psoe.getMinute()');

  equals(
    this.pmoe.getMinute(),
    34,
    'pmoe.getMinute()');

  equals(
    this.peoe.getMinute(),
    59,
    'peoe.getMinute()');

  equals(
    this.nsoe.getMinute(),
    0,
    'nsoe.getMinute()');

  equals(
    this.nmoe.getMinute(),
    34,
    'nmoe.getMinute()');

  equals(
    this.neoe.getMinute(),
    59,
    'neoe.getMinute()');

  equals(
    this.zero.getMinute(),
    0,
    'zero.getMinute()');

  equals(
    this.minus_one.getMinute(),
    59,
    'minus_one.getMinute()');

  equals(
    this.local.getMinute(),
    34,
    'local.getMinute()');
});

test('ADT.prototype.getSecond', function() {
  expect(9);

  equals(
    this.psoe.getSecond(),
    0,
    'psoe.getSecond()');

  equals(
    this.pmoe.getSecond(),
    41,
    'pmoe.getSecond()');

  equals(
    this.peoe.getSecond(),
    59,
    'peoe.getSecond()');

  equals(
    this.nsoe.getSecond(),
    0,
    'nsoe.getSecond()');

  equals(
    this.nmoe.getSecond(),
    41,
    'nmoe.getSecond()');

  equals(
    this.neoe.getSecond(),
    59,
    'neoe.getSecond()');

  equals(
    this.zero.getSecond(),
    0,
    'zero.getSecond()');

  equals(
    this.minus_one.getSecond(),
    59,
    'minus_one.getSecond()');

  equals(
    this.local.getSecond(),
    41,
    'local.getSecond()');
});
